<%@ page language="java" pageEncoding="UTF-8" %>
<!doctype html>
<html lang="zh-CN">
<head>
    <%@include file="/WEB-INF/views/commons/common.jsp" %>
    <link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/bootstrap-dialog3/css/bootstrap-dialog.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/validation-engine/validationEngine.jquery.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/jquery-easyui/1.4.3/themes/metro/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/font-awesome/4.3.0/css/font-awesome.min.css">

    <link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/webuploader/0.1.5/webuploader.css">
    <link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/viewer/viewer.css">
    <link rel="stylesheet" type="text/css" href="${base_href}//static/ui-frame/ztree-v3/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" type="text/css" href="${base_href}/static/css/search-theme.css">
    <link rel="stylesheet" type="text/css" href="${base_href}/static/css/form-theme.css">

    <title>我的试卷</title>
</head>
<body data-spy="scroll" data-target="#myScrollspy" data-offset="350">


<div class="main-wrap">

    <!-- 工具条 start-->
    <div class="container-fluid form-body-header">
        <div class="container">
            <div class="row tool-bar">
                <div class="col-xs-12">
                    <button type="button" class="btn btn-sm tool-btn" id="closeBtn">关闭</button>
                    <button type="button" class="btn btn-sm tool-btn" id="exportBtn">导出试卷</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 工具条 end-->

    <!-- 表单 start-->
    <div class="container-fluid">
        <form id="form">

            <input type="hidden" name="id" value="${form.id }"/>

            <div class="container form-body-div">
                <div class="row text-center title-body" id="baseinfo">
                    试卷详细信息<br/>
                </div>
                <div class="row pannel-title">
                    <span>基本信息</span> <a href="javascript:void(0);" class="hide-next-btn">收起</a>
                </div>
                <div class="row pannel-body">
                    <table class="form-table">
                        <tr>
                            <th class="col-xs-2 ">创建人</th>
                            <td class="col-xs-4">
                                ${form.createUserName}
                            </td>
                            <th class="col-xs-2 ">创建时间</th>
                            <td class="col-xs-4">
                                <fmt:formatDate value="${form.createTime}" type="both" pattern="yyyy-MM-dd HH:mm"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="col-xs-2 ">试卷名称</th>
                            <td class="col-xs-4" colspan="3">
                                ${form.paperName}
                            </td>

                        </tr>
                    </table>
                    <table class="form-table">
                        <tr>
                            <th class="col-xs-1 ">
                                题目编号
                            </th>
                            <th class="col-xs-8" colspan="2">
                                题目信息
                            </th>
                            <th class="col-xs-1 ">
                                设置分数
                            </th>
                        </tr>
                        <c:forEach items="${form.paperDetails}" var="detail" varStatus="status">
                            <tr class="quesDetail">
                                <td class="col-xs-1 ">
                                    <input type="hidden" name="paperDetails[${status.index }].quesId"
                                           value="${detail.quesId}">
                                    <input type="hidden" name="paperDetails[${status.index }].paperId"
                                           value="${detail.paperId}">
                                    第${status.index+1}题<br>
                                        ${detail.quesCode}<br>
                                        ${detail.quesTypeValue}
                                </td>
                                <td class="col-xs-8" colspan="2">
                                    <c:choose>
                                        <c:when test="${detail.stem eq '' || detail.stem eq null}">
                                            &nbsp;&nbsp;&nbsp;&nbsp;题目：${detail.question}
                                        </c:when>
                                        <c:otherwise>
                                            &nbsp;&nbsp;&nbsp;&nbsp;主题干：${detail.question}<br>
                                            &nbsp;&nbsp;&nbsp;&nbsp;分题干：${detail.stem}
                                        </c:otherwise>
                                    </c:choose>
                                    <c:forEach items="${detail.options }" var="option" varStatus="optionStatus">
                                        <div class="checkbox checkbox-success">
                                            <label for="myAnswer['${status.index}']['${optionStatus.index }']">
                                                    ${answers[optionStatus.index] }：${option}
                                            </label>
                                        </div>
                                    </c:forEach>
                                    &nbsp;&nbsp;&nbsp;&nbsp;正确答案：${detail.answer }<br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;解析：${detail.analysis }<br>
                                </td>
                                <td class="col-xs-1 ">
                                        ${detail.score}
                                </td>
                            </tr>
                        </c:forEach>
                    </table>
                </div>
            </div>
        </form>
    </div>
    <!-- 表单 end-->

</div>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap/3.3.5/js/bootstrap.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap-dialog3/js/bootstrap-dialog.js"></script>
<script type="text/javascript"
        src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
    $(function () {
        $("#closeBtn").click(function () {
            window.close();
        });

        $("#exportBtn").click(function () {
            BootstrapDialog.show({
                title: "提示框",
                message: "此功能还在开发中...",
                buttons: [{
                    label: "确认",
                    action: function (dialog) {
                        dialog.close();
                    }
                }]
            });
// 			return $.post(basePath+ "/paper/savePaper.json",$("#form").serialize(), function(){
// 				BootstrapDialog.show({
// 					title: "提示框",
// 					message: "保存成功",
// 					buttons: [{
// 						label: "确认",
// 						action: function(dialog){
// 							dialog.close();
// 						}
// 					}]
// 				});
// 			},'json');
        });
    });

</script>
</body>
</html>
